import { Button } from "antd";

export default function examinationColumn(updateExamination,deleExamination) {
  const stuColumns = [
    {
      title: '序号',
      dataIndex: 'index',
      key: 'index',
      align: 'center',
      render: (text, record, index) => {
        return text;
      },
    },
    {
      title: '课程',
      align: 'center',
      dataIndex: 'fd_curriculumName',
    },
    {
      title: '课程编号',
      align: 'center',
      dataIndex: 'fd_curriculumNum',
    },
    {
      title: '开始时间',
      align: 'center',
      dataIndex: 'fd_startTime',
    },
    {
      title: '结束时间',
      align: 'center',
      dataIndex: 'fd_endTime',
    },
    {
      title: '地点',
      align: 'center',
      dataIndex: 'fd_classroomName',
    },
    {
      title: '考核方式',
      align: 'center',
      dataIndex: 'fd_assessmentMethod',
      render: (text, record, index) => {
        if (text === 1) return "开卷"
        if (text === 2) return "闭卷"
        if (text === 3) return "考察"
      },
    },
    {
      title: '备注',
      align: 'center',
      dataIndex: 'fd_remark',
    },
  ];

  const teaColumns = [
    {
      title: '序号',
      dataIndex: 'index',
      key: 'index',
      align: 'center',
      render: (text, record, index) => {
        return text;
      },
    },
    {
      title: '课程',
      align: 'center',
      dataIndex: 'fd_curriculumName',
    },
    {
      title: '课程编号',
      align: 'center',
      dataIndex: 'fd_curriculumNum',
    },
    {
      title: '开始时间',
      align: 'center',
      dataIndex: 'fd_startTime',
    },
    {
      title: '结束时间',
      align: 'center',
      dataIndex: 'fd_endTime',
    },
    {
      title: '地点',
      align: 'center',
      dataIndex: 'fd_classroomName',
    },
    {
      title: '考核方式',
      align: 'center',
      dataIndex: 'fd_assessmentMethod',
      render: (text, record, index) => {
        if (text === 1) return "开卷"
        if (text === 2) return "闭卷"
        if (text === 3) return "考察"
      },
    },
    {
      title: '班级',
      align: 'center',
      dataIndex: 'fd_claName',
    },
    {
      title: '备注',
      align: 'center',
      dataIndex: 'fd_remark',
    },
    {
      title: '操作',
      dataIndex: 'operation',
      align:'center',
      width:124,
      render: (_, record) => {
        return (
          <>
            <Button onClick={() => updateExamination(record)} size='small'  >修改</Button>
            <Button onClick={() => deleExamination(record)} size='small'  >删除</Button>
          </>
        )
      }
    }
  ];

  return {stuColumns,teaColumns}
}